from selenium.webdriver.common.by import By
from page.base_page import BasePage
class Class(BasePage):
    ele_Classification_loc='new UiSelector().className("android.widget.LinearLayout").instance(11)'
    ele_Cuisine_loc=(106,926)
    ele_SichuanCuisine_loc=(344,427)
    ele_filter_loc=(By.XPATH,'//android.widget.ImageView[@resource-id="com.gfeng.daydaycook:id/filterIv"]')
    ele_hot_loc=(By.XPATH,'//android.widget.TextView[@text="辣"]')
    ele_saute_loc=(By.XPATH,'//android.widget.TextView[@text="炒"]')
    ele_minute_loc=(By.XPATH,'//android.widget.TextView[@text="30分钟"]')
    ele_Cancel_loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.gfeng.daydaycook:id/backTv"]')
    def slide_down(self):#向下滑动
        self.driver.swipe(434, 1566, 434, 1200, 500)
    def ele_Classification(self):# 点击分类
        self.driver.find_element_by_android_uiautomator(self.ele_Classification_loc).click()
    def ele_Cuisine(self): # 点击菜系
        self.driver.tap([self.ele_Cuisine_loc],250)
    def ele_SichuanCuisine(self):# 点击川菜
        self.driver.tap([self.ele_SichuanCuisine_loc],200)
    def ele_filter(self):#点击筛选
        self.driver.find_element(*self.ele_filter_loc).click()
    def ele_hot(self):# 点击辣
        self.driver.find_element(*self.ele_hot_loc).click()
    def ele_saute(self):#点击炒
        self.driver.find_element(*self.ele_saute_loc).click()
# sleep(1)
# driver.swipe(434,1566,434,1100,500)
    def ele_minute(self):# 点击30分钟
        self.driver.find_element(*self.ele_minute_loc).click()
    def ele_Cancel(self):# 点击取消
        self.driver.find_element(*self.ele_Cancel_loc).click()
